package ${package.Parent}.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.wang.cloud.common.core.api.ApiResult;
import ${package.Parent}.domain.co.${entity?replace('Entity', '')}AddCo;
import ${package.Parent}.domain.co.${entity?replace('Entity', '')}PageCo;
import ${package.Parent}.domain.co.${entity?replace('Entity', '')}UpdateCo;
import ${package.Parent}.domain.vo.${entity?replace('Entity', '')}PageVo;
import ${package.Parent}.domain.vo.${entity?replace('Entity', '')}Vo;
import ${package.Parent}.factory.${entity?replace('Entity', 'Client')}FallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * ${table.comment!} feign
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@FeignClient(name = "${package.ModuleName}", path = "<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/${controllerMappingHyphen?replace("-entity","")?replace("-","/")}", fallbackFactory = ${entity?replace('Entity', 'Client')}FallbackFactory.class)
public interface ${entity?replace('Entity', 'Client')} {

    @Operation(summary = "分页查询")
    @GetMapping("page")
    ApiResult<PageDTO<${entity?replace('Entity', 'PageVo')}>> page(@SpringQueryMap ${entity?replace('Entity', 'PageCo')} pageCo);

    @Operation(summary = "获取详情")
    @GetMapping("info")
    ApiResult<${entity?replace('Entity', 'Vo')}> page(@RequestParam Long id);

    @Operation(summary = "新增")
    @PostMapping("add")
    ApiResult<Long> add(@RequestBody ${entity?replace('Entity', 'AddCo')} addCo);

    @Operation(summary = "更新")
    @PostMapping("update")
    ApiResult update(@RequestBody ${entity?replace('Entity', 'UpdateCo')} updateCo);

    @Operation(summary = "删除")
    @DeleteMapping("del")
    ApiResult del(@RequestParam Long id);
}